package com.chandra.pos.order.model;

/**
 * Created with IntelliJ IDEA.
 * User: Admin
 * Date: 11/16/13
 * Time: 1:23 AM
 * To change this template use File | Settings | File Templates.
 */
public enum ShippingStatus {

    SHIPPED(1, "Shipped"),
    PARTIAL_SHIPPED(1, "Shipped"),
    NOT_SHIPPED(2, "Partial Shipped"),
    RETURNED(6, "Returned");


    private final int id;   // in kilograms

    private final String name;

    ShippingStatus(int id, String name) {
        this.id = id;
        this.name = name;

    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public ShippingStatus getType(int id) {

        ShippingStatus[] types = ShippingStatus.values();

        for (ShippingStatus type : types) {
            if (type.getId() == id)
                return type;
        }
        return null;
    }
}
